/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.agtranscontinental.dgs001.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ericson
 */
@Entity
@Table(name = "empresa")
@NamedQueries({
    @NamedQuery(name = "Empresa.findAll", query = "SELECT e FROM Empresa e"),
    @NamedQuery(name = "Empresa.findByIdEps", query = "SELECT e FROM Empresa e WHERE e.idEps = :idEps"),
    @NamedQuery(name = "Empresa.findByRazscEps", query = "SELECT e FROM Empresa e WHERE e.razscEps = :razscEps"),
    @NamedQuery(name = "Empresa.findByRucEps", query = "SELECT e FROM Empresa e WHERE e.rucEps = :rucEps"),
    @NamedQuery(name = "Empresa.findByConttEps", query = "SELECT e FROM Empresa e WHERE e.conttEps = :conttEps"),
    @NamedQuery(name = "Empresa.findByTelfnEps", query = "SELECT e FROM Empresa e WHERE e.telfnEps = :telfnEps"),
    @NamedQuery(name = "Empresa.findByTipEps", query = "SELECT e FROM Empresa e WHERE e.tipEps = :tipEps"),
    @NamedQuery(name = "Empresa.findByDrcEps", query = "SELECT e FROM Empresa e WHERE e.drcEps = :drcEps"),
    @NamedQuery(name = "Empresa.findByUbgoEps", query = "SELECT e FROM Empresa e WHERE e.ubgoEps = :ubgoEps")})
public class Empresa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_eps")
    private Integer idEps;
    @Size(max = 100)
    @Column(name = "razsc_eps")
    private String razscEps;
    @Size(max = 15)
    @Column(name = "ruc_eps")
    private String rucEps;
    @Size(max = 100)
    @Column(name = "contt_eps")
    private String conttEps;
    @Size(max = 15)
    @Column(name = "telfn_eps")
    private String telfnEps;
    @Column(name = "tip_eps")
    private Integer tipEps;
    @Size(max = 120)
    @Column(name = "drc_eps")
    private String drcEps;
    @Size(max = 6)
    @Column(name = "ubgo_eps")
    private String ubgoEps;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "empresa")
    private List<Personal> personalList;
    @JoinColumn(name = "id_svceps", referencedColumnName = "id_svceps")
    @ManyToOne
    private ServicioEmpresa servicioEmpresa;

    public Empresa() {
    }

    public Empresa(Integer idEps) {
        this.idEps = idEps;
    }

    public Integer getIdEps() {
        return idEps;
    }

    public void setIdEps(Integer idEps) {
        this.idEps = idEps;
    }

    public String getRazscEps() {
        return razscEps;
    }

    public void setRazscEps(String razscEps) {
        this.razscEps = razscEps;
    }

    public String getRucEps() {
        return rucEps;
    }

    public void setRucEps(String rucEps) {
        this.rucEps = rucEps;
    }

    public String getConttEps() {
        return conttEps;
    }

    public void setConttEps(String conttEps) {
        this.conttEps = conttEps;
    }

    public String getTelfnEps() {
        return telfnEps;
    }

    public void setTelfnEps(String telfnEps) {
        this.telfnEps = telfnEps;
    }

    public Integer getTipEps() {
        return tipEps;
    }

    public void setTipEps(Integer tipEps) {
        this.tipEps = tipEps;
    }

    public String getDrcEps() {
        return drcEps;
    }

    public void setDrcEps(String drcEps) {
        this.drcEps = drcEps;
    }

    public String getUbgoEps() {
        return ubgoEps;
    }

    public void setUbgoEps(String ubgoEps) {
        this.ubgoEps = ubgoEps;
    }

    public List<Personal> getPersonalList() {
        return personalList;
    }

    public void setPersonalList(List<Personal> personalList) {
        this.personalList = personalList;
    }

    public ServicioEmpresa getServicioEmpresa() {
        return servicioEmpresa;
    }

    public void setServicioEmpresa(ServicioEmpresa servicioEmpresa) {
        this.servicioEmpresa = servicioEmpresa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEps != null ? idEps.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Empresa)) {
            return false;
        }
        Empresa other = (Empresa) object;
        if ((this.idEps == null && other.idEps != null) || (this.idEps != null && !this.idEps.equals(other.idEps))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.agtranconstinental.dgs001.model.Empresa[ idEps=" + idEps + " ]";
    }
    
}
